with open('./qqq/bill.txt','r+',encoding='utf-8')as f,open('./qqq/bill.txt','w',encoding='utf-8')as f1:
    res=f.read()
    f1.write(res)
    s=""
    for line in res.split('\n'):
        if '测试' not in line:
            s += line +'\n'
    # 回转指针
    f.seek(0)
    # 清空内容
    f.truncate()
    # 写入新内容
    f.write(s)
        
